<?php
$this->breadcrumbs=array(
	'Statidums'=>array('index'),
	$model->name,
);


?>
<style type="text/css">
.content-tnm-col-left{
	background:url(../images/sub-content-left.png) repeat-y;
	width:970px;
	padding: 2px 20px;
	overflow:auto;
	position:relative;
	height:460px}

</style>

<h1>Thông tin sân <?php echo $model->name ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'stadium_type_id',
		'name',		
	),
)); ?>

<?php 
$price = $model->type->price;
$arrCurrentPrice = array();
if(is_null($model->all_price))
{
    for ($day = 0 ; $day < 7; $day++) {
        for ($hour = 0; $hour < 24; $hour++) {
            $arrCurrentPrice[$day][$hour] = $price;
        }
    }   
}
else
{
    $arrCurrentPrice = unserialize($model->all_price);
}
?>

<h3>Thông tin tiền sân <?php echo $model->name ?></h3>
<form id="frmAjaxPrice" method="post">
<table class="detail-view">
    <tr>
        <td> Giờ
        </td>
        <td>
            T2 
        </td>
        <td>
            T3 
        </td>
        <td>
            T4 
        </td>
        <td>
            T5 
        </td>
        <td>
            T6 
        </td>
        <td>
            T7 
        </td>
        <td>
            CN 
        </td>
    </tr>
    <?php for ($hour = 0; $hour < 24; $hour++): ?>
    <tr class="<?php if($hour%2) echo 'odd'; else echo 'even'; ?>">
        <td> 
            <?php echo $hour; ?>:00 
        </td>
        <?php for ($day = 0 ; $day < 7; $day++): ?>
        <td>
            <input type="text" value="<?php echo $arrCurrentPrice[$day][$hour] ?>" name="price[<?php echo $day ?>][<?php echo $hour ?>]" style="width: 80px;" /> 
        </td>
        <?php endfor; ?>
    </tr>      
    <?php endfor; ?>
    <tr>
        <td colspan="4"> <input type="submit" name="submit" value="Lưu thay đổi" id="savePrice"/>
        </td>
        <td colspan="4"></td>
    </tr>
</table>
</form>
<script type="text/javascript">
$().ready(function(){
//   $('#savePrice').click(function(){
//        alert($('#frmAjaxPrice').serialize());
//        return false;
//   }); 
});
</script>